home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_2 / ispell-3.3ljr / ispell / ispell.h < prev    next >
C/C++ Source or Header  |  1992-10-08  |  10KB  |  316 lines

  1. #pragma msg 148 ignore push
  2. #pragma msg 149 ignore push
  3. #pragma msg 61 ignore push
  4. #include <clib/exec_protos.h>
  5. #include <pragmas/exec_pragmas.h>
  6. #include <clib/rexxsyslib_protos.h>
  7. #include <pragmas/rexxsyslib_pragmas.h>
  8. #pragma msg 149 pop
  9. #pragma msg 61 pop
  10. #include "minrexx.h"
  11.  
  12. struct dent {
  13.     struct dent *next;
  14.     char *word;
  15.  
  16.     unsigned int used : 1;
  17.  
  18. /* bit fields for all of the flags */
  19.     unsigned int v_flag : 1;
  20.         /*
  21.             "V" flag:
  22.                 ...E --> ...IVE  as in CREATE --> CREATIVE
  23.                 if # .ne. E, ...# --> ...#IVE  as in PREVENT --> PREVENTIVE
  24.         */
  25.     unsigned int n_flag : 1;
  26.         /*
  27.             "N" flag:
  28.                     ...E --> ...ION  as in CREATE --> CREATION
  29.                     ...Y --> ...ICATION  as in MULTIPLY --> MULTIPLICATION
  30.                     if # .ne. E or Y, ...# --> ...#EN  as in FALL --> FALLEN
  31.         */
  32.     unsigned int x_flag : 1;
  33.         /*
  34.             "X" flag:
  35.                     ...E --> ...IONS  as in CREATE --> CREATIONS
  36.                     ...Y --> ...ICATIONS  as in MULTIPLY --> MULTIPLICATIONS
  37.                     if # .ne. E or Y, ...# --> ...#ENS  as in WEAK --> WEAKENS
  38.         */
  39.     unsigned int h_flag : 1;
  40.         /*
  41.             "H" flag:
  42.                     ...Y --> ...IETH  as in TWENTY --> TWENTIETH
  43.                     if # .ne. Y, ...# --> ...#TH  as in HUNDRED --> HUNDREDTH
  44.         */
  45.     unsigned int y_flag : 1;
  46.         /*
  47.             "Y" FLAG:
  48.                     ... --> ...LY  as in QUICK --> QUICKLY
  49.         */
  50.     unsigned int g_flag : 1;
  51.         /*
  52.             "G" FLAG:
  53.                     ...E --> ...ING  as in FILE --> FILING
  54.                     if # .ne. E, ...# --> ...#ING  as in CROSS --> CROSSING
  55.         */
  56.     unsigned int j_flag : 1;
  57.         /*
  58.             "J" FLAG"
  59.                     ...E --> ...INGS  as in FILE --> FILINGS
  60.                     if # .ne. E, ...# --> ...#INGS  as in CROSS --> CROSSINGS
  61.         */
  62.     unsigned int d_flag : 1;
  63.         /*
  64.             "D" FLAG:
  65.                     ...E --> ...ED  as in CREATE --> CREATED
  66.                     if @ .ne. A, E, I, O, or U,
  67.                             ...@Y --> ...@IED  as in IMPLY --> IMPLIED
  68.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  69.                             ...@# --> ...@#ED  as in CROSS --> CROSSED
  70.                                             or CONVEY --> CONVEYED
  71.         */
  72.     unsigned int t_flag : 1;
  73.         /*
  74.             "T" FLAG:
  75.                     ...E --> ...EST  as in LATE --> LATEST
  76.                     if @ .ne. A, E, I, O, or U,
  77.                             ...@Y --> ...@IEST  as in DIRTY --> DIRTIEST
  78.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  79.                             ...@# --> ...@#EST  as in SMALL --> SMALLEST
  80.                                             or GRAY --> GRAYEST
  81.         */
  82.     unsigned int r_flag : 1;
  83.         /*
  84.             "R" FLAG:
  85.                     ...E --> ...ER  as in SKATE --> SKATER
  86.                     if @ .ne. A, E, I, O, or U,
  87.                             ...@Y --> ...@IER  as in MULTIPLY --> MULTIPLIER
  88.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  89.                             ...@# --> ...@#ER  as in BUILD --> BUILDER
  90.                                             or CONVEY --> CONVEYER
  91.         */
  92.     unsigned int z_flag : 1;
  93.         /*
  94.             "Z FLAG:
  95.                     ...E --> ...ERS  as in SKATE --> SKATERS
  96.                     if @ .ne. A, E, I, O, or U,
  97.                             ...@Y --> ...@IERS  as in MULTIPLY --> MULTIPLIERS
  98.                     if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U)
  99.                             ...@# --> ...@#ERS  as in BUILD --> BUILDERS
  100.                                             or SLAY --> SLAYERS
  101.         */
  102.     unsigned int s_flag : 1;
  103.         /*
  104.             "S" FLAG:
  105.                     if @ .ne. A, E, I, O, or U,
  106.                             ...@Y --> ...@IES  as in IMPLY --> IMPLIES
  107.                     if # .eq. S, X, Z, or H,
  108.                             ...# --> ...#ES  as in FIX --> FIXES
  109.                     if # .ne. S,X,Z,H, or Y, or (# = Y and @ = A, E, I, O, or U)
  110.                             ...# --> ...#S  as in BAT --> BATS
  111.                                             or CONVEY --> CONVEYS
  112.         */
  113.     unsigned int p_flag : 1;
  114.         /*
  115.             "P" FLAG:
  116.                     if @ .ne. A, E, I, O, or U,
  117.                             ...@Y --> ...@INESS  as in CLOUDY --> CLOUDINESS
  118.                     if # .ne. Y, or @ = A, E, I, O, or U,
  119.                             ...@# --> ...@#NESS  as in LATE --> LATENESS
  120.                                             or GRAY --> GRAYNESS
  121.         */
  122.     unsigned int m_flag : 1;
  123.         /*
  124.             "M" FLAG:
  125.                     ... --> ...'S  as in DOG --> DOG'S
  126.         */
  127.  
  128.     unsigned int keep : 1;
  129.  
  130. #ifdef CAPITALIZE
  131.     /*
  132.     ** if followcase is set, the actual word entry (dent->word)
  133.     ** is followed by one or more further strings giving exact
  134.     ** capitalizations.   The first byte after the uppercase word
  135.     ** gives the number of capitalizations.  Each capitalization
  136.     ** is preceded by the character "+" if it is to be kept, or
  137.     ** "-" if it is to be discarded from the personal dictionary.
  138.     ** For example, the entry "ITCORP\0\3+ITcorp\0+ITCorp\0+ItCorp\0"
  139.     ** gives various ways of writing my e-mail address.  If all-lowercase
  140.     ** is acceptable, an all-lower entry must appear.  Simple
  141.     ** capitalization, on the other hand, is signified by the "capitalize"
  142.     ** flag.
  143.     **
  144.     ** Suffixes always match the case of the final character of a word.
  145.     **
  146.     ** If "allcaps" is set, the other two flags must be clear.
  147.     */
  148.     unsigned int allcaps : 1;    /* Word must be all capitals */
  149.     unsigned int capitalize : 1;    /* Capitalize the word */
  150.     unsigned int followcase : 1;    /* Follow capitalization exactly */
  151.     /*
  152.     ** The following entries denote the flag values that are actually
  153.     ** to be kept for this dictionary entry.  They may differ if the
  154.     ** "a" command is used for a word that differs only in capitalization.
  155.     */
  156.     unsigned int k_allcaps : 1;
  157.     unsigned int k_capitalize : 1;
  158.     unsigned int k_followcase : 1;
  159. #endif
  160.  
  161. };
  162.  
  163. #define WORDLEN 30
  164.  
  165. struct hashheader {
  166.     int magic;
  167.     int stringsize;
  168.     int tblsize;
  169. };
  170.  
  171. /* hash table magic number */
  172. #define MAGIC 2
  173.  
  174.  
  175. extern int aflag;
  176. extern int lflag;
  177.  
  178. extern int li, co;    /* lines, columns */
  179.  
  180. extern char rootword[BUFSIZ];
  181. extern struct dent *lastdent;
  182.  
  183. extern char *hashstrings;
  184. extern struct hashheader hashheader;
  185.  
  186. extern char tempfile[200];
  187.  
  188. /* In ispell.c */
  189. void servermode (void);
  190. void disp (struct RexxMsg *msg, struct rexxCommandList *dat, char *p);
  191. void rexxadd (struct RexxMsg *msg, char *p);
  192. void rexxquickadd (struct RexxMsg *msg, char *p);
  193. void rexxcheck (struct RexxMsg *msg, char *p);
  194. void rexxquickcheck (struct RexxMsg *msg, char *p);
  195. void rexxlookup (struct RexxMsg *msg, char *p);
  196. void rexxfilecheck (struct RexxMsg *msg, char *p);
  197. void rexxextendedfilecheck (struct RexxMsg *msg, char *p);
  198. void rexxversion (struct RexxMsg *msg, char *p);
  199. void rexxexit (struct RexxMsg *msg, char *p);
  200.  
  201. void givehelp (void);
  202. void usage (void);
  203. void main (int argc, char **argv);
  204. void dofile (char *filename);
  205. void checkfile (void);
  206. void correct (char *token, char **currentchar);
  207. void show_line (char *line, char *invstart, int invlen);
  208. int show_char (int ch, int linew);
  209. int line_size (char *buf, char *bufend);
  210. void inserttoken (char *buf, char *start, char *token, char **currentchar);
  211. int casecmp (char *a, char *b);
  212. void makepossibilities (char *word);
  213. int insert (char *word);
  214. int wrongcapital (char *word);
  215. void wrongletter (char *word);
  216. void extraletter (char *word);
  217. void missingletter (char *word);
  218. void transposedletter (char *word);
  219. int ins_cap (char *word, char *pattern);
  220. char *getline (char *s);
  221. void askmode (void);
  222. void copyout (char **cc, int cnt);
  223. void lookharder (char *string);
  224. void regex_dict_lookup (char *cmd, char *grepstr);
  225.  
  226. /* In amiga.c */
  227. void setcolors (char *style, char *fg, char *bg);
  228. void printcon (char *fmt,...);
  229. void putccon (int ch);
  230. int getccon (void);
  231. int rawmode (int flag);
  232. LONG sendpkt (struct MsgPort *pid, LONG action, LONG args[], LONG nargs);
  233. void terminit (void);
  234. void done (void);
  235. void erase (void);
  236. void move (int row, int col);
  237. void inverse (void);
  238. void normal (void);
  239. void backup (void);
  240. void onstop (int signo);
  241. void stop (void);
  242. void sleep (int n);
  243.  
  244. /* In good.c */
  245. int good (char *w);
  246. int cap_ok (char *word, struct dent * dent);
  247. void flagpr (char *w, int flag, char *modpoint);
  248. void g_ending (char *w, int n);
  249. void d_ending (char *w, int n);
  250. void t_ending (char *w, int n);
  251. void r_ending (char *w, int n);
  252. void h_ending (char *w, int n);
  253. void s_ending (char *w, int n);
  254. void n_ending (char *w, int n);
  255. void e_ending (char *w, int n);
  256. void y_ending (char *w, int n);
  257. int vowel (int c);
  258.  
  259. /* In hash.c */
  260. unsigned int hash (char *s, int n, int hashsize);
  261.  
  262. /* In local.c */
  263. void lldump (void);
  264. void llinsert (char *s);
  265.  
  266. /* In lookup.c */
  267. int linit (void);
  268. struct dent *lookup (char *s, int n, int dotree);
  269. char *do_regex_lookup (char *regex, int whence);
  270.  
  271. /* In minrexx.c */
  272. long upRexxPort (char *s, struct rexxCommandList *rcl, char *exten, void(*uf)(struct RexxMsg *, struct rexxCommandList *, char *));
  273. void closeRexxLib (void);
  274. void dnRexxPort (void);
  275. void dispRexxPort (void);
  276. int cmdcmp (char *c, char *m);
  277. int openRexxLib (void);
  278. struct RexxMsg *sendRexxCmd (char *s, void (*f)(struct RexxMsg *msg), STRPTR p1, STRPTR p2, STRPTR p3);
  279. struct RexxMsg *asyncRexxCmd (char *s);
  280. void replytoit (struct RexxMsg *msg);
  281. struct RexxMsg *syncRexxCmd (char *s, struct RexxMsg *msg);
  282. void replyRexxCmd (struct RexxMsg *msg, long primary, long secondary, char *string);
  283.  
  284. /* In regex.c */
  285. void re_fail (char *s, int c);
  286. char *re_comp (char *pat);
  287. char *pmatch (char *lp, char *ap);
  288. int re_exec (char *lp);
  289. void re_modw (char *s);
  290. int re_subs (char *src, char *dst);
  291. int dfadump (char *ap);
  292.  
  293. /* In tree.c */
  294. void treeinit (char *p);
  295. struct dent *treeinsert (char *word, int keep);
  296. struct dent *treelookup (char *word);
  297. int pdictcmp (struct dent **enta, struct dent **entb);
  298. void treeoutput (void);
  299. char *upcase (char *s);
  300. char *lowcase (char *s);
  301.  
  302. /* In xgets.c */
  303. char *xgets (char *str);
  304.  
  305. /* In buildhash.c */
  306. void output (void);
  307. void filltable (void);
  308. void readdict (void);
  309. int makedent (char *lbuf, struct dent *d);
  310. void newcount (void);
  311.  
  312. /* In rexxvars.o */
  313. int __stdargs CheckRexxMsg (struct RexxMsg *);
  314. int __stdargs GetRexxVar (struct RexxMsg *, char *, char **);
  315. int __stdargs SetRexxVar (struct RexxMsg *, char *, char *, int);
  316.